package com.r_z.util;

import com.r_z.result.CommonResult;


public class RequestMsg {

    public static <T> CommonResult msg(int count, T t) {
        CommonResult commonResult;
        if (count != 0) commonResult = new CommonResult("OK", "Query Success!", count, t);
        else {
            commonResult = new CommonResult("Failure", "Query failure, can't find these payment records!", 0, null);
        }
        return commonResult;
    }

    public static <T> CommonResult msg(T t) {
        CommonResult commonResult;
        if (t != null)
            commonResult = new CommonResult("OK", "Query Success!", 1, t);
        else {
            commonResult = new CommonResult("Failure", "Query failure, can't find these payment records!", 0, null);
        }
        return commonResult;
    }
}
